<meta charset="utf-8">
    <title>线下充值审核列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="网站描述">
    <meta name="keywords" content="">
    <meta name="author" content="wangl">
    <link rel="icon" href="http://ow9lg82yy.bkt.clouddn.com/24f5c360-485d-4a6d-9468-2a61c353cf37.ico">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all">
    <link rel="stylesheet" href="/static/css/user.css" media="all">
    <link rel="stylesheet" href="/static/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

</head>
<body class="childrenBody">
<div class="layui-col-xs12">
    <fieldset class="layui-elem-field">
        <legend>线下充值审核列表</legend>
    </fieldset>

    <div class="layui-form users_list">

                        <#--class="layui-table-header"-->
                        <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                            <thead>
                            <tr>
                            <#--<th data-field="0" data-unresize="true">-->
                            <#--<div class="layui-table-cell laytable-cell-1-0 laytable-cell-checkbox"><input-->
                            <#--type="checkbox" name="layTableCheckbox" lay-skin="primary"-->
                            <#--lay-filter="layTableAllChoose">-->
                            <#--<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i-->
                            <#--class="layui-icon"></i></div>-->
                            <#--</div>-->
                            <#--</th>-->
                                <!-- 编号、货币图标、货币名称、货币单价、已配发、已激活、已释放、已冻结、已回购、已交易、今日交易、创建时间、操作 -->
                                <th data-field="anid">
                                    <div class="layui-table-cell laytable-cell-1-anid"><span>编号</span></div>
                                </th>
                                <th data-field="title">
                                    <div class="layui-table-cell laytable-cell-1-title"><span>订单号</span></div>
                                </th>
                                <th data-field="content">
                                    <div class="layui-table-cell laytable-cell-1-anid"><span>用户id</span></div>
                                </th>
                                <th data-field="link">
                                    <div class="layui-table-cell laytable-cell-1-link"><span>充值金额</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>支付状态</span></div>
                                </th>
                            <#--<th data-field="publistTime" data-unresize="true">-->
                            <#--<div class="layui-table-cell laytable-cell-1-publistTime"><span>已配发</span></div>-->
                            <#--</th>-->
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-publistTime"><span>支付时间</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>持卡人姓名</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-link"><span>开户银行</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-publistTime"><span>银行卡号</span></div>
                                </th>
                                <th data-field="9">
                                    <div class="layui-table-cell laytable-cell-1-9" align="center"><span>操作</span></div>
                                </th>
                            </tr>
                            </thead>
                            <tbody id="rechargeHistoryDtoList">
                            </tbody>
                        </table>
                        <div class="box-tools pull-right">
                            <ul class="pagination" id="pagination_ul">
                            </ul>
                        </div>

    </div>
</div>
</body>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/tools.js"></script>
<script type="text/javascript" src="/static/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/static/js/CodeConst.js"></script>
<script type="text/javascript" src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<script type="text/javascript" src="/static/js/oss.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script>


    function setCompleted(id) {
        $.get("/back/recharge/offline/complete?rechargeId="+id, function (data) {
            init();
        });
    }

    function setFail(id) {
        $.get("/back/recharge/offline/fail?rechargeId="+id, function (data) {
            init();
        });
    }


    //遍历baseDto
    function loadData(baseDto) {
        if (baseDto.code == ERROR)
            console.log(baseDto.msg);
        else {
            //数据
            var data = baseDto.data.list;
            var text = "";
            <!-- 编号、货币图标、货币名称、货币单价、已配发、已激活、已释放、已冻结、已回购、已交易、今日交易、创建时间、操作 -->
            $.each(data, function (index, rechargeHistoryDto) {
                var operations = "";
                if(rechargeHistoryDto.paymentStatus == "未支付")
                {
                    operations +=
                            "                            <a onclick='setCompleted("+rechargeHistoryDto.id+")' class=\"layui-btn layui-btn-danger layui-btn-xs\" lay-event=\"del\">通过</a>\n"+
                            "                            <a onclick='setFail("+rechargeHistoryDto.id+")' class=\"layui-btn layui-btn-danger layui-btn-xs\" lay-event=\"del\">拒绝</a>\n"
                            ;
                }
                printJson(rechargeHistoryDto);
                text += "<tr>\n" +
                        "<td>" + rechargeHistoryDto.id+ "</td>\n" +
                        "<td> " + rechargeHistoryDto.outTradeNo + "</td>\n" +
                        "<td>" + rechargeHistoryDto.userId + "</td>\n" +
                        "<td >" + rechargeHistoryDto.fee + "</td>\n" +
                        "<td>" + rechargeHistoryDto.paymentStatus + "</td>\n" +
                        "<td>" + rechargeHistoryDto.createTime + "</td>\n" +
                        "<td>" + rechargeHistoryDto.receiveCard.holderName + "</td>\n" +
                        "<td>" + rechargeHistoryDto.receiveCard.openBank + "</td>\n" +
                        "<td>" + rechargeHistoryDto.receiveCard.bankCardNum + "</td>\n" +
                        "<td class=\"text-center\" align=\"center\">\n" +
                            operations;
                        "</td>\n" +
                        "</tr>";
            });
            var rechargeHistoryDtoList = $("#rechargeHistoryDtoList");
            rechargeHistoryDtoList.empty();//清空子元素
            rechargeHistoryDtoList.append($(text));


        }
    }

    function loadPage(pageNum)
    {

        $.ajax(
                {
                    url: '/back/recharge/offline/all?pageNum='+pageNum,
                    type: "GET",
                    success: function (baseDto) {
                        loadData(baseDto);
                    }
                }
        );
    }


    var laypage = 0;
    layui.use(['laypage', 'layer'], function(){
        laypage = layui.laypage;
        //获取所有广告信息






    });
    function loadPage(pageNum)
    {
        $.get("/back/recharge/offline/all?pageNum="+pageNum,function (baseDto) {
            loadData(baseDto);
        })
    }

    function init() {
        //获取数据
        $.ajax({
            url: "/back/recharge/offline/all",
            type: "GET",
            success: function (baseDto) {
                loadData(baseDto);
                baseDto = baseDto.data;
                laypage.render({
                    elem: 'pagination_ul'
                    ,count: baseDto.total
                    ,curr: baseDto.fristPage //获取起始页
                    ,limit: 10
                    ,jump: function (obj) {
                        loadPage(obj.curr);
                    }

                });
            }
        });
    }
    init();


</script>


</html>

